package org.abacus.standard;

import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

public class AppMain {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				createAndShowGUI();
			}
		});

	}

	protected static void createAndShowGUI() {
		JDialog jDialog = new JDialog();
		jDialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
		jDialog.setTitle("BASE64加密/解密");
		jDialog.setSize(400, 330);
		jDialog.setResizable(false);
		setCenter(jDialog);
		createGroupPanel(jDialog);
		jDialog.setVisible(true);

	}

	public static void setCenter(Component comp) {
		Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
		comp.setBounds((dim.width - comp.getWidth()) / 2, (dim.height - comp.getHeight()) / 2, comp.getWidth(), comp.getHeight());
	}

	public static void createGroupPanel(JDialog jDialog) {
		JPanel jPanel = new JPanel();
		Box box = new Box(1);

		jPanel.add(box);

		jPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(244, 244, 0)), "填写信息"));
		jDialog.add(jPanel);
	}
}
